package org.cpoy.eims.entity;

// Generated Feb 24, 2011 8:45:00 AM by Hibernate Tools 3.3.0.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Student generated by hbm2java
 */
@Entity
@Table(name = "student")
public class Student implements java.io.Serializable {

	private int id;
	private UserAccount userAccount;
	private Course course;
	private String firstName;
	private String lastName;
	private String passportPhotoUrl;
	private Date dateOfBirth;
	private Integer registerNumber;
	private Integer rollNumber;
	private Set<StudentPreviousAcadDetails> studentPreviousAcadDetailses = new HashSet<StudentPreviousAcadDetails>(
			0);
	private Set<StudentCerficate> studentCerficates = new HashSet<StudentCerficate>(
			0);
	private Set<Parent> parents = new HashSet<Parent>(0);
	private Set<StudentCertificateLocation> studentCertificateLocations = new HashSet<StudentCertificateLocation>(
			0);
	private Set<StudentExtraDetails> studentExtraDetailses = new HashSet<StudentExtraDetails>(
			0);
	private Set<StudentEmergencyContact> studentEmergencyContacts = new HashSet<StudentEmergencyContact>(
			0);

	public Student() {
	}

	public Student(int id, Course course, String firstName, String lastName,
			Date dateOfBirth) {
		this.id = id;
		this.course = course;
		this.firstName = firstName;
		this.lastName = lastName;
		this.dateOfBirth = dateOfBirth;
	}

	public Student(int id, UserAccount userAccount, Course course, String firstName,
			String lastName, String passportPhotoUrl, Date dateOfBirth,
			Integer registerNumber, Integer rollNumber,
			Set<StudentPreviousAcadDetails> studentPreviousAcadDetailses,
			Set<StudentCerficate> studentCerficates, Set<Parent> parents,
			Set<StudentCertificateLocation> studentCertificateLocations,
			Set<StudentExtraDetails> studentExtraDetailses,
			Set<StudentEmergencyContact> studentEmergencyContacts) {
		this.id = id;
		this.userAccount = userAccount;
		this.course = course;
		this.firstName = firstName;
		this.lastName = lastName;
		this.passportPhotoUrl = passportPhotoUrl;
		this.dateOfBirth = dateOfBirth;
		this.registerNumber = registerNumber;
		this.rollNumber = rollNumber;
		this.studentPreviousAcadDetailses = studentPreviousAcadDetailses;
		this.studentCerficates = studentCerficates;
		this.parents = parents;
		this.studentCertificateLocations = studentCertificateLocations;
		this.studentExtraDetailses = studentExtraDetailses;
		this.studentEmergencyContacts = studentEmergencyContacts;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public UserAccount getUserAccount() {
		return this.userAccount;
	}

	public void setUserAccount(UserAccount userAccount) {
		this.userAccount = userAccount;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "course_id", nullable = false)
	@NotNull
	public Course getCourse() {
		return this.course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	@Column(name = "first_name", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "last_name", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "passport_photo_url", length = 150)
	@Length(max = 150)
	public String getPassportPhotoUrl() {
		return this.passportPhotoUrl;
	}

	public void setPassportPhotoUrl(String passportPhotoUrl) {
		this.passportPhotoUrl = passportPhotoUrl;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date_of_birth", nullable = false, length = 10)
	@NotNull
	public Date getDateOfBirth() {
		return this.dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	@Column(name = "register_number")
	public Integer getRegisterNumber() {
		return this.registerNumber;
	}

	public void setRegisterNumber(Integer registerNumber) {
		this.registerNumber = registerNumber;
	}

	@Column(name = "roll_number")
	public Integer getRollNumber() {
		return this.rollNumber;
	}

	public void setRollNumber(Integer rollNumber) {
		this.rollNumber = rollNumber;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
	public Set<StudentPreviousAcadDetails> getStudentPreviousAcadDetailses() {
		return this.studentPreviousAcadDetailses;
	}

	public void setStudentPreviousAcadDetailses(
			Set<StudentPreviousAcadDetails> studentPreviousAcadDetailses) {
		this.studentPreviousAcadDetailses = studentPreviousAcadDetailses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
	public Set<StudentCerficate> getStudentCerficates() {
		return this.studentCerficates;
	}

	public void setStudentCerficates(Set<StudentCerficate> studentCerficates) {
		this.studentCerficates = studentCerficates;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
	public Set<Parent> getParents() {
		return this.parents;
	}

	public void setParents(Set<Parent> parents) {
		this.parents = parents;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
	public Set<StudentCertificateLocation> getStudentCertificateLocations() {
		return this.studentCertificateLocations;
	}

	public void setStudentCertificateLocations(
			Set<StudentCertificateLocation> studentCertificateLocations) {
		this.studentCertificateLocations = studentCertificateLocations;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
	public Set<StudentExtraDetails> getStudentExtraDetailses() {
		return this.studentExtraDetailses;
	}

	public void setStudentExtraDetailses(
			Set<StudentExtraDetails> studentExtraDetailses) {
		this.studentExtraDetailses = studentExtraDetailses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
	public Set<StudentEmergencyContact> getStudentEmergencyContacts() {
		return this.studentEmergencyContacts;
	}

	public void setStudentEmergencyContacts(
			Set<StudentEmergencyContact> studentEmergencyContacts) {
		this.studentEmergencyContacts = studentEmergencyContacts;
	}

}
